package com.example.ruleenginelearning.example.rules;

import com.example.ruleenginelearning.example.engine.OrderRule;
import com.example.ruleenginelearning.example.model.Order;

public class NewOrderRule implements OrderRule {

    @Override
    public boolean evaluate(Order order) {
        return "NEW".equals(order.getStatus());
    }

    @Override
    public void execute(Order order) {
        System.out.println("处理新订单: " + order.getId() +
                " | 商品数: " + order.getItemCount());
        order.setStatus("PROCESSING");
    }
}
